home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Utilities / AmisED / scripts / AGIndexCreator.rexx next >
OS/2 REXX Batch file  |  1999-12-19  |  1KB  |  57 lines

  1. /* AmigaGuide Index creator for AMIS */
  2.  
  3. OPTIONS RESULTS
  4. SIGNAL ON SYNTAX
  5. SIGNAL ON BREAK_C
  6.  
  7. 'Query NAME'
  8. name=result
  9. 'Query POS'
  10. pos=result
  11. 'File NAME="'||name||'.index" NEW'
  12. 'AutoIndent OFF'
  13. 'Viewer NAME="AmigaGuide"'
  14. 'Insert TEXT="¶@node INDEX¶¶¶@endnode¶"'
  15. 'CursUp 2'
  16. 'SelectWindow NAME="'||name||'"'
  17. 'Query LINES'
  18. lines=result
  19. 'Cursup TOP'
  20. 'Graphics OFF'
  21. line=1
  22. 'GetLine'
  23. text=result
  24. do while line<=lines
  25.   if upper(left(text,5))="@NODE" then
  26.   do
  27.     'SelectWindow NAME="'||name||'.index"'
  28.     parse var text '@node' test1 test2
  29.     if test2="" then
  30.     do
  31.       test2=test1
  32.       test1=left(test1,length(test1)-1)
  33.     end
  34.     test1=strip(strip(test1),,'"')
  35.     test2=strip(strip(left(test2,length(test2)-1)),,'"')
  36.     'Insert TEXT="    @{*"'||test2||'*" link *"'||test1||'*"}¶"'
  37.     'SelectWindow NAME="'||name||'"'
  38.   end
  39.   line=line+1
  40.   'Goto LINE='||line
  41.   'GetLine'
  42.   text=result
  43. end
  44. 'Goto POS='||pos
  45. 'Graphics ON'
  46. 'SelectWindow NAME="'||name||'.index"'
  47. 'CursUp TOP'
  48. exit
  49.  
  50. SYNTAX:
  51. say "Sorry, error line" SIGL ":" ERRORTEXT(RC) ":-("
  52. exit
  53.  
  54. BREAK_C:
  55. say "*** Break"
  56. exit
  57.